<!DOCTYPE html>
<html>

<head>
  <title>Server Management - AIL</title>
	<link rel="icon" href="{{ url_for('static', filename='image/ail-icon.png') }}">

  <!-- Core CSS -->
	<link href="{{ url_for('static', filename='css/bootstrap4.min.css') }}" rel="stylesheet">
	<link href="{{ url_for('static', filename='css/font-awesome.min.css') }}" rel="stylesheet">

  <!-- JS -->
	<script src="{{ url_for('static', filename='js/jquery.js')}}"></script>
	<script src="{{ url_for('static', filename='js/bootstrap4.min.js')}}"></script>

</head>
<body>

  {% include 'nav_bar.html' %}

	<div class="container-fluid">
		<div class="row">

			{% include 'settings/menu_sidebar.html' %}
            <div class="col-12 col-lg-10" id="core_content">

                <div class="text-center my-4">
                    <h2><img src="{{ url_for('static', filename='image/ail-project.png')}}" alt="AIL" style="width:80px;"> Modules:</h2>
                </div>
                <object data="{{ url_for('static', filename='image/ail_queues.svg') }}" type="image/svg+xml" style="width:100%;"></object>

                <h3 class="mt-4">Modules</h3>
                <table class="table mb-4">
                    <thead class="bg-dark text-white">
                    <tr>
                        <th>Module Name</th>
                        <th>Nb Modules Launched</th>
                        <th>Nb in Queue</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for module_stats in queues_stats %}
                        <tr>
                            <td>{{ module_stats }}</td>
                            <td>
                                {% if queues_stats[module_stats]['modules'] %}
                                    {{ queues_stats[module_stats]['modules'] | length }}
                                {% else %}
                                    0
                                {% endif %}
                            </td>
                            <td>{{ queues_stats[module_stats]['in'] }}</td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>

            </div>
		</div>
	</div>

</body>

<script>
$(document).ready(function(){
    $("#modules").addClass("active");
	$("#nav_doc").removeClass("text-muted");
} );

function toggle_sidebar(){
	if($('#nav_menu').is(':visible')){
		$('#nav_menu').hide();
		$('#side_menu').removeClass('border-right')
		$('#side_menu').removeClass('col-lg-2')
		$('#core_content').removeClass('col-lg-10')
	}else{
		$('#nav_menu').show();
		$('#side_menu').addClass('border-right')
		$('#side_menu').addClass('col-lg-2')
		$('#core_content').addClass('col-lg-10')
	}
}

</script>

</html>
